<html>
<head><meta charset="utf-8"><title>Starting with Polonius · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html">Starting with Polonius</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210682843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210682843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Zhang <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210682843">(Sep 20 2020 at 20:08)</a>:</h4>
<p>Hi, I read the blog posts linked here (<a href="https://rust-lang.github.io/compiler-team/working-groups/polonius/">https://rust-lang.github.io/compiler-team/working-groups/polonius/</a>) and am interested in learning more about Polonius or hacking on it. What is the current status of the project?</p>
<p>I also noticed that the example in the README (<code>inputs/clap-rs/app-parser-\{\{impl\}\}-add_defaults</code>) takes around 2 minutes to run for me, rather than 4 seconds - just wondered if I'm doing something wrong. Thanks!</p>



<a name="210684023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210684023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210684023">(Sep 20 2020 at 20:33)</a>:</h4>
<p>The latter might be debug vs release mode; which did you use?</p>



<a name="210687684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210687684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Zhang <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210687684">(Sep 20 2020 at 22:06)</a>:</h4>
<p>I ran it with release mode using the same command from the README:</p>
<div class="codehilite"><pre><span></span><code>➜  polonius git:(master) cargo +nightly run --release -- -a DatafrogOpt inputs/clap-rs/app-parser-\{\{impl\}\}-add_defaults/
    Finished release [optimized] target(s) in 0.03s
     Running `target/release/polonius -a DatafrogOpt &#39;inputs/clap-rs/app-parser-{{impl}}-add_defaults/&#39;`
--------------------------------------------------
Directory: inputs/clap-rs/app-parser-{{impl}}-add_defaults/
Time: 150.710s
</code></pre></div>



<a name="210688772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210688772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Zhang <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210688772">(Sep 20 2020 at 22:37)</a>:</h4>
<p>Actually, I just replaced datafrog_opt::compute() with a function that does nothing, and it still takes &gt;2 minutes to run. Is it just that reading the input facts takes a long time?</p>



<a name="210704383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210704383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vytautas Astrauskas [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210704383">(Sep 21 2020 at 06:08)</a>:</h4>
<blockquote>
<p>Is it just that reading the input facts takes a long time?</p>
</blockquote>
<p>Are you using a shared drive? I know that using a local copy of a Windows share can cause serious performance problems.</p>



<a name="210728901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210728901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210728901">(Sep 21 2020 at 11:35)</a>:</h4>
<p>Hi :) (I believe you're the author of <code>crepe</code> <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span>)</p>



<a name="210728983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210728983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210728983">(Sep 21 2020 at 11:36)</a>:</h4>
<p><code>clap</code>, which is the biggest function benchmarked in-tree, does indeed unfortunately take 2 minutes nowadays instead of 4 seconds (and is of course a bug)</p>



<a name="210729016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210729016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210729016">(Sep 21 2020 at 11:37)</a>:</h4>
<p>the part taking a long time now is the move/init analysis</p>



<a name="210729329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210729329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210729329">(Sep 21 2020 at 11:41)</a>:</h4>
<p>it's the first part of the computation: computing both move errors and init/uninit data used by the next part of the computation (liveness, which precedes the "borrowck"ing parts you've commented out, <code>datafrog_opt::compute</code>) -- specifically it's the move errors rules which are taking the longest time IIRC (one could comment the 2-3 related to those in <a href="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/initialization.rs#L120">this function</a> and have <code>clap</code> go faster, it doesn't have any move error)</p>



<a name="210729480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210729480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210729480">(Sep 21 2020 at 11:43)</a>:</h4>
<p>the move errors are in flux at the moment, in the recent spring Niko and Albin have devised a set of different rules to help with this efficiency problem, and other questions of preciseness (and avoiding false positives), and have started looking at actually emitting these move errors in rustc (right now polonius will compute them, slowly as you've seen, but rustc doesn't emit them yet)</p>



<a name="210729613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Starting%20with%20Polonius/near/210729613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Starting.20with.20Polonius.html#210729613">(Sep 21 2020 at 11:45)</a>:</h4>
<p>however I don't know from the top of my head the exact status of both strands of work besides that there's in-progress work, maybe <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> could comment here :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>